﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="author" content="ISUX">
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <title>工作经历登记</title>
    <link rel="stylesheet" href="/ViewMob/css/wxui.css">
    <link rel="stylesheet" href="/ViewMob/css/group.css">
    <link href="//at.alicdn.com/t/font_qqztt1cpq09kke29.css" rel="stylesheet" />
    <link href="/ViewMob/js/layer/need/layer.css" rel="stylesheet" />
    <script src="/ViewMob/js/layer/layer.m.js"></script>
    <style>
        .page {
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            opacity: 0;
            z-index: 1;
        }

            .page.js_show {
                opacity: 1;
            }

        .page__hd {
            padding: 40px;
            text-align: center;
            background: #4faeff url(../images/bg-account.jpg) 100% 100%;
            color: white;
        }

        .page__bd_spacing {
            padding: 0 15px;
        }

        .page__ft {
            padding-top: 40px;
            padding-bottom: 10px;
            text-align: center;
        }

            .page__ft img {
                height: 19px;
            }

            .page__ft.j_bottom {
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
            }

        .page__title {
            text-align: left;
            font-size: 20px;
            font-weight: 400;
        }

        .page__desc {
            margin-top: 5px;
            text-align: left;
            font-size: 14px;
        }

        .page.home .page__intro-icon {
            margin-top: -.2em;
            margin-left: 5px;
            width: 16px;
            height: 16px;
            vertical-align: middle;
        }

        .page.home .page__title {
            font-size: 0;
            margin-bottom: 15px;
        }


        .head-oneself {
            width: 4.5rem;
            height: 4.5rem;
            margin-left: 20px;
        }

            .head-oneself img {
                border: 2px solid rgba(0,0,0,.2);
            }

        .ybl {
            background-color: #10c55b;
            font-size: 30px;
            color: white;
        }

        .wbl {
            background-color: lightgray;
            font-size: 20px;
            color: white;
        }

        .YZ {
            POSITION: absolute;
            RIGHT: 10PX;
            TOP: 10PX;
            FONT-SIZE: 70PX;
            COLOR: #ff0000;
            line-height: 70px;
        }
    </style>
</head>
<body style="background-color: #f8f8f8;" ms-controller="PAGE">
    <div class="page__hd">
        <h1 class="page__title">工作经历等级</h1>
        <p class="page__desc"></p>
    </div>
    <div class="page__bd">
        <div class="weui-cells weui-cells_form" style="margin-top: 0" id="city">
            <div class="weui-cell weui-cell_select weui-cell_select-after" style="height:45px">
                <div class="weui-cell__hd">
                    <label for="" class="weui-label">省</label>
                </div>
                <div class="weui-cell__bd">
                    <select class="weui-select prov"></select>
                </div>
            </div>
            <div class="weui-cell weui-cell_select weui-cell_select-after" style="height:45px">
                <div class="weui-cell__hd">
                    <label for="" class="weui-label">地市</label>
                </div>
                <div class="weui-cell__bd">
                    <select class="weui-select city"></select>
                </div>
            </div>
            <div class="weui-cell weui-cell_select weui-cell_select-after" style="height:45px">
                <div class="weui-cell__hd">
                    <label for="" class="weui-label">市县</label>
                </div>
                <div class="weui-cell__bd" id="gszl">
                    <select class="weui-select dist"></select>
                </div>
            </div>
            <div class="weui-cell weui-cell_select weui-cell_select-after">
                <div class="weui-cell__hd">
                    <label for="" class="weui-label">公司类型</label>
                </div>
                <div class="weui-cell__bd">
                    <select class="weui-select regSel" ms-duplex="nowwork.corp_type">
                        <option value="">请选择公司类型</option>

                        <option>政府单位</option>
                        <option>事业单位</option>
                        <option>跨国企业</option>
                        <option>国企</option>
                        <option>大型民营企业</option>
                        <option>中小型民营企业</option>
                        <option>其它</option>
                    </select>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">公司名称</label>
                </div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="text" ms-duplex="nowwork.corp_name">
                </div>

            </div>
            <div class="weui-cell weui-cell_select weui-cell_select-after">
                <div class="weui-cell__hd">
                    <label for="" class="weui-label">岗位类别</label>
                </div>
                <div class="weui-cell__bd">
                    <select id="gwlb" name="gwlb" class="regSel weui-select" style="width: 243px" ms-duplex="nowwork.gwlbdm">
                        <option value="">请选择岗位类别</option>
                        <option ms-repeat-el="gwdata" ms-attr-value="{{el.ID}}">{{el.gwlb}}</option>
                    </select>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">职称</label>
                </div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="text" ms-duplex="nowwork.zc">
                </div>

            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">年薪(万元)</label>
                </div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="text" ms-duplex="nowwork.nx">
                </div>

            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">开始年月</label>
                </div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="month" ms-duplex="nowwork.begin_nf">
                </div>

            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">结束年月</label>
                </div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="month" ms-duplex="nowwork.end_nf">
                </div>

            </div>
        </div>

        <a href="#" id="tjdata" class="weui-btn weui-btn_primary" style="margin: 20px" ms-click="savegzjl()">提交数据</a>
    </div>

    <script src="../js/jquery-1.11.1.min.js"></script>
    <script src="/ViewMob/js/weui.min.js"></script>
    <script src="/ViewMob/js/avalon1.47.js"></script>
    <script src="/WEB/JS/jquery.cityselect.js"></script>
    <script>
        var model = avalon.define({
            $id: "PAGE",
            bz: "1",//当前步骤
            userdata: {},
            nowwork: {},
            gwdata: {},
            savegzjl: function () {
                model.nowwork.corp_province = $("#city").find(".prov").val();
                model.nowwork.corp_city = $("#city").find(".city").val();
                model.nowwork.corp_country = $("#city").find(".dist").val();
                model.nowwork.xh = model.userdata.xh;
                model.nowwork.xm = model.userdata.xm;
                model.nowwork.ID = 0;
                $.post("/API/VIEWAPI.ashx?Action=Commanage_SAVEWORKDATA&r=" + Math.random(), { data: JSON.stringify(model.nowwork) }, function (resultData) {
                    if (JSON.parse(resultData).ErrorMsg == "") {
                        alert('操作成功')
                        
                        location.href = "UI_GZJL.html";
                    }
                    else {
                        alert(JSON.parse(resultData).ErrorMsg)
                    }
                });
            }

        })
        avalon.ready(function () {
            model.userdata = JSON.parse(getCookie('userdata'));

            $.getJSON("/API/VIEWAPI.ashx?Action=Commanage_GETWORKJL&r=" + Math.random(), { xh: model.userdata.xh, workid: getQueryString("workid", "0") }, function (resultData) {
                if (resultData.ErrorMsg == "") {
                    model.nowwork = resultData.Result1;
                    model.gwdata = resultData.Result2;
                    if (model.nowwork.corp_province) {
                        $("#city").citySelect({
                            prov: model.nowwork.corp_province,
                            city: model.nowwork.corp_city,
                            dist: model.nowwork.corp_country,
                            nodata: "none"
                        });
                    } else {
                        $("#city").citySelect({
                            prov: model.userdata.now_province,
                            city: model.userdata.now_city,
                            dist: model.userdata.now_district,
                            nodata: "none"
                        });
                    }


                } else {
                    alert(resultData.ErrorMsg)
                }
            });
        })

        function getCookie(name) {
            var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");

            if (arr = document.cookie.match(reg))

                return unescape(arr[2]);
            else
                return null;
        }
        function setCookie(name, value, t) {
            var Days = 30;
            var exp = new Date();
            if (t) {
                exp.setTime(exp.getTime() + parseInt(t) * 24 * 60 * 60 * 1000);
            } else {
                exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
            }
            if (window.location.toString().indexOf("qijieyun") > 0) {
                document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path=/;domain=qijieyun.com";
            } else {
                document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path=/";
            }
        }

        function getQueryString(name, defauval) {//获取URL参数,如果获取不到，返回默认值，如果没有默认值，返回空格
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) { return unescape(decodeURI(r[2])); }
            else {
                return defauval || "";
            }
        }
    </script>
</body>
</html>
